package com.chat.netty.server.runner;

import com.chat.netty.server.core.NettyService;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @Auther created by haoteng on 2019/08/16
 */
@Component
@Order(value = 1)
public class ServerRunner implements CommandLineRunner {

    @Override
    public void run(String... args) throws Exception {

        ExecutorService exec = Executors.newSingleThreadExecutor();
        exec.execute(new NettyStart());
    }

    private class NettyStart implements Runnable {
        @Override
        public void run() {
            NettyService service = new NettyService();
//            service.start();
        }
    }
}
